Skip to content

fix(id): restore Committed-arm sequence succession uses checked_add (#8370) - #8380

Merged
dezren39 merged 1 commit into
mainfrom
queue/14804-8370-checked-add
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14804-8370-checked-add

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #8370 (gap found by the #4001 closing audit, design #4000 decision 2).

WorldCore::restore_inner's JournalEntry::Committed arm in pkgs/id/src/world/core.rs was the remaining succession predicate using saturating_add: at core.sequence == u64::MAX the saturated successor equals the current sequence, so a committed event with sequence MAX passed the "advance by one" check without advancing — and repeated MAX events would each pass it again during replay.

  • Predicate changed to core.sequence.checked_add(1) == Some(event.sequence), the shape the checkpoint-part predicate in the same file already uses.
  • Regression test restore_committed_sequence_does_not_wrap_at_u64_max (world/tests.rs), mirroring restore_checkpoint_sequence_does_not_wrap_at_u64_max: after a checkpoint at u64::MAX, a committed event with sequence MAX is refused with the "journal sequence jumps" error.

Verification

  • cargo test --lib -- restore_ in pkgs/id on the laptop, on this head: 41 passed, 0 failed (lib) — including the new test and the existing checkpoint boundary test.

Task 14804, lane code-g.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 01:09
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56d0d7c2-a52c-426c-bf58-737609c15813
Commits

Reviewing files that changed from the base of the PR and between 0696e54 and 73680e4.

Files selected for processing: 2

  • pkgs/id/src/world/core.rs
  • pkgs/id/src/world/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T01:10:56.479111Z 73680e4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

state: parked
task: 14804
lane: code-g
pr: 8380
outcome: pr_opened_ci_wait

Task 14804 (issue #8370): fix opened as PR #8380 (branch queue/14804-8370-checked-add, +53/-1). The restore Committed-arm succession predicate now uses checked_add, with regression test restore_committed_sequence_does_not_wrap_at_u64_max.

Local verification on the laptop on this head: cargo test --lib -- restore_ in pkgs/id — 41 passed, 0 failed, including the new test and the existing checkpoint boundary test. PR checks are pending in the fleet CI stall; parking as a CI wait. Resume: merge PR #8380 when checks complete and any Codex findings are dispositioned — the PR body carries "Fixes #8370", so merging closes this issue.

@dezren39
dezren39 merged commit 599f4f2 into main Nov 11, 2026
3 of 13 checks passed
@dezren39
dezren39 deleted the queue/14804-8370-checked-add branch November 11, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(id): restore Committed-arm sequence succession must be checked_add, not saturating_add (#4001 audit)

1 participant